import { Component, OnInit } from '@angular/core';
import { MemberService } from '../../member.server';
import { LayoutRourteStatus } from 'src/app/model/status';
import { MessageService } from 'src/app/core/service';
import { StorageService } from 'src/app/core/sotrage/storage.service';

@Component({
    templateUrl: './member-center-settings.component.html',
    styleUrls: ['./member-center-settings.component.scss']
})
export class MemberCenterSettingsComponent implements OnInit {

    public isVisible = false;

    public isFundPwd: boolean;

    private _layoutRourteStatus: LayoutRourteStatus = {
        url: '/member/center/account',
        manu2Url: '/member/center/account/setting',
        isHiddeBreadcrumb: true,
        breadcrumbs: [
            { tragetTitle: '账户中心' }
        ]
    };

    ngOnInit() {
        this.msg.sendLayoutRourteStatus(this._layoutRourteStatus);
        const user = this.storageService.get('wenyao-web-fallet-user-info');
        if(user){
            this.isFundPwd = user['isFundPwd'] ;
        };
    }

    async addBank(data) {
        const teg = await this.memberServer.getAJX('创建银行', data);
        this.memberServer.getApiSuccess(teg, { bool: true, msg: '创建银行成功！' }) ? this.successListOk(teg.data, '创建银行') : '';
    }

    public successListOk(data, url): void {
        switch (url) {
            case '获取币提现(余额,费率等)':
                break;
        }
    }
    public toggleCollapse(): void {
    }
    public getAll(e): void {
    }
    public handleOk(todata): void {
    }
    public onAddBank(todata): void {
    }
    public selBankCard(e): void {
    }


    handleCancel(): void {
        this.isVisible = false;
    }

    constructor(
        private memberServer: MemberService,
        private storageService: StorageService,
        private msg: MessageService
    ) {
    }
}
